﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MINERP.FactoryGrid
{
    public partial class FrmSelectGrid : Form
    {
        public FrmSelectGrid()
        {
            InitializeComponent();
        }
        public DataTable  DTgrid { get; set; }
        public string InputProductCode { get; set; }

        public int SelectedGridID { get; set; }//选择的GRIDID
        public string SelectedGridName { get; set; }//选择的格子名称

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void FrmSelectGrid_Load(object sender, EventArgs e)
        {
            comboBox1.DataSource = DTgrid;
            comboBox1.DisplayMember = "GridName";
            comboBox1.ValueMember = "GridId";

           label1.Text = string.Format("请为产品{0}选择要放入的格子!", InputProductCode);
        }

        private void FrmSelectGrid_FormClosing(object sender, FormClosingEventArgs e)
        {
            SelectedGridID = Convert.ToInt32(comboBox1.SelectedValue);
            SelectedGridName = comboBox1.SelectedText;
        }
    }
}
